﻿#include "EjectCommand.h"

#include "../../../Memory/GameData.h"

bool EjectCommand_onExecute(const fast_io::vector<std::u8string>& args) {
	if (args.size() > 2 || args.empty())
		return false;
	if (args.size() == 2) {
		using std::operator""sv;
		if (args[1] == u8"advance"sv) {
			extern bool advanceExit;
			advanceExit = true;
		} else
			return false;
	}
	GameData::terminate();
	extern bool isRunning;
	isRunning = false;
	return true;
}

ICommand EjectCommand{u8"eject",
					  u8".eject [advance]",
					  {u8"eject Helium from the game.", u8"从游戏中卸载Helium。", u8"從遊戲中卸載Helium。", u8"ゲームから Helium をアンインストールします。"},
					  {u8"uninject"},
					  fast_io::vector<aliasList_struct>{aliasList_struct{stringview_Object{u8"advance", nullptr}}},  // If empty must use fast_io::vector<aliasList_struct>{}
					  nullptr,
					  &EjectCommand_onExecute};